﻿using Hospital.API.Dto;
using Hospital.Domain;
using Hospital.ErrorCode;

namespace Hospital.API.HospitalServices.IServices
{
    public interface IOrderRecordServices
    {
        /// <summary>
        /// 获取开单记录列表
        /// </summary>
        /// <param name="queryDto">查询条件</param>
        /// <returns>开单记录列表</returns>
        Task<APIResult<APIPaging<List<OrderRecord>>>> GetOrderRecordList(OrderRecordQueryDto queryDto);

        /// <summary>
        /// 获取开单记录详情
        /// </summary>
        /// <param name="id">开单记录ID</param>
        /// <returns>开单记录详情</returns>
        Task<APIResult<OrderRecordDetailDto>> GetOrderRecordById(int id);

        /// <summary>
        /// 创建开单申请
        /// </summary>
        /// <param name="createDto">创建开单申请DTO</param>
        /// <returns>创建结果</returns>
        Task<APIResult<OrderRecord>> CreateOrderRecord(CreateOrderRecordDto createDto);

        /// <summary>
        /// 更新支付状态
        /// </summary>
        /// <param name="updateDto">更新支付状态DTO</param>
        /// <returns>更新结果</returns>
        Task<APIResult<bool>> UpdatePaymentStatus(UpdatePaymentStatusDto updateDto);

        /// <summary>
        /// 取消开单申请
        /// </summary>
        /// <param name="id">开单记录ID</param>
        /// <returns>取消结果</returns>
        Task<APIResult<bool>> CancelOrderRecord(int id);

        /// <summary>
        /// 获取院区列表
        /// </summary>
        /// <returns>院区列表</returns>
        Task<APIResult<List<HospitalBranch>>> GetHospitalBranchList();

        /// <summary>
        /// 获取检查项目列表
        /// </summary>
        /// <param name="typeId">项目类型ID（可选）</param>
        /// <returns>检查项目列表</returns>
        Task<APIResult<List<CheckItem>>> GetCheckItemList(int? typeId = null);

        /// <summary>
        /// 获取检查项目类型列表
        /// </summary>
        /// <param name="parentId">父级类型ID（可选）</param>
        /// <returns>检查项目类型列表</returns>
        Task<APIResult<List<CheckItemType>>> GetCheckItemTypeList(int? parentId = null);

        /// <summary>
        /// 获取已选项目的详细信息
        /// </summary>
        /// <param name="selectedItemIds">已选项目ID列表</param>
        /// <returns>已选项目的详细信息</returns>
        Task<APIResult<List<SelectedItemDetailDto>>> GetSelectedItemsDetail(List<int> selectedItemIds);

        /// <summary>
        /// 计算已选项目的总价
        /// </summary>
        /// <param name="selectedItems">已选项目列表</param>
        /// <returns>总价信息</returns>
        Task<APIResult<OrderSummaryDto>> CalculateOrderSummary(List<OrderItemDto> selectedItems);
    }
}
